$(document).ready(function ()
{
    var right = screen.availWidth - 235;
    $('#right').css('width', right);

    var userkind = $('#ctl00_userkind').text();
    if (userkind == '普通用户')//普通用户移除所属用户项
    {
        //var trList = $('#gridview tr');
	    $('#gridview tr>th:nth-child(3)').remove();
		$('#gridview tr>td:nth-child(3)').remove();
        /*for (var i = 0; i < trList.length; i++)
        {
           // trList[i].children[2].removeNode();
			//trList.remove(trList[i].children[2]);
        }*/
    }
	var autoDatas;
	var sorttype=$('#ctl00_lblsb').text();       //搜索类型
	if(sorttype=="设备搜索")
	{
			$.ajax({
		type:"POST",
		contentType:"application/json",
		url:"autocomplete.ashx/GetNvrSn",
		//url:"auto.ashx",
		data:"{}",
		dataType:"json",
		success: function(val){
			//alert('xxxx');
			autoDatas=eval('(' + val.d + ')');
		},
		async:false,
		timeout:3000
	});
	}
	
	if(sorttype=="用户搜索")
	{
	   $.ajax({
		type:"POST",
		contentType:"application/json",
		url:"autocomplete.ashx/GetUser",
		//url:"auto.ashx",
		data:"{}",
		dataType:"json",
		success: function(val){
			//alert('xxxx');
			autoDatas=eval('(' + val.d + ')');
		},
		async:false,
		timeout:3000
	});
	}
	$('input[id$=txtIput]').autocomplete(autoDatas, {
		formatItem: function (row, i, max) {return "<table width='180px'><tr><td align='left'>" + row.Key + "</td></tr></table>";},
		formatMatch:function(row,i,max){return row.Key;}
	});
});